home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload Trio 2 / Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO / dir24 / nosinst.zip / TUTORETC.ZIP / FTPTUTOR.TXT next >
Text File  |  1993-12-13  |  20KB  |  529 lines

  1. How to use ftp on g4poi hub - g4poi July 12th 1993
  2.  
  3. =========================================================================
  4.                      A PRACTICAL GUIDE TO USING FTP
  5. =========================================================================
  6.  
  7.  
  8. The following describes how to use ftp to send and retrieve files to and
  9. from the g4poi hub (or any other station).
  10.  
  11.  
  12. FTP:
  13. ====
  14. ftp means "File Transfer Protocol". ftp is used primarily to transfer
  15. large amounts of information or programs where smtp (simple mail transfer
  16. protocol) is inappropriate or cannot handle non printable characters.
  17.  
  18.  
  19. CONNECTING TO AN FTP HOST:
  20. ==========================
  21. The syntax of the command ftp is;       ftp <host>
  22. <host> is the callsign of the station you wish to act as an ftp server.
  23. (That is, as a station that you can get files from or send them to).
  24.  
  25. So at your command screen, you type;    ftp g4poi
  26.  
  27. Your own computer will open a new window (Amiga) or give you a new empty
  28. screen (PC) with session information at the top.
  29.  
  30. Before you can type any commands, you will need to log into the ftp
  31. server on the remote station, the host. This is usually automatic but if
  32. it isn't, type your callsign where it asks for your name, and type your
  33. name when it asks for the password.
  34.  
  35.  
  36. You can make logging on automatic by changing the contents of your
  37. NOS.RC file. If you wish to log into g4poi for instance and your callsign
  38. is g9xyz and your name is ethelbert, the entry in your NOS.RC file should
  39. read;
  40.          g4poi g9xyz ethelbert
  41.  
  42. And providing the host knows you(!) they will give you permission to move
  43. around quite freely.
  44.  
  45.  
  46. On the g4poi hub, the ftp server tells you where you are in the directories
  47. before giving you a prompt. So if you are a known user on the system, it
  48. will say something like;
  49.  
  50. 230- "/usr/g9zzz" is the current directory
  51. ftp>
  52.  
  53. If you are not known on the system, you will only have access to the
  54. public areas so you would see;
  55.  
  56. 230- Logged in as anonymous - restrictions apply
  57.  
  58. and;
  59.  
  60. 230- "/public" is the current directory
  61. ftp>
  62.  
  63.  
  64. The "ftp>" is the prompt I mentioned a moment ago. When you see this, it
  65. means that the "host" is ready for you to type a command. If you do not
  66. see this, be patient. The "host" station is probably a little busy.
  67.  
  68. 230- The funny number at the start of each message line is just a part
  69. 230- of ftp. You can tell the "host" to cut out the waffle by specifying
  70. 230- different verbose levels, but that comes later...
  71.  
  72.  
  73. NAVIGATING THE DIRECTORIES:
  74. ===========================
  75. As users of the g4poi hub, you will be in your /usr/callsign area when
  76. you first connect. You do not have to be put there first. I can alter
  77. your configurations on the system so you arrive at /public if you wish.
  78.  
  79. First, let's clear up the confusion about the use of "/".
  80.  
  81. If you see a filename or a directory name with a "/" to the left of it,
  82. and nothing to the left of the "/", it means that file/directory is right
  83. at the root of the directory structure. Examples;
  84.  
  85.  
  86. /public     \
  87.              |
  88. /in-tray     |-- Are all right down as low as you can get in the "tree".
  89.              |   In other words, there is nothing beneath them to get
  90. /usr        /    into (at least that's how it appears).
  91.  
  92.  
  93. If you see another "/" separating one directory name from another or from
  94. a file, it means that it is being used to say that to get to this file
  95. (or directory), you must get to it using this particular path.
  96.  
  97.  
  98. Example;
  99.  
  100. /public/debate/nntp.txt
  101.    |      |       |_____ to get to this file (in this instance)
  102.    |      |______________ you need to come via here
  103.    |______________________ from here.
  104.  
  105.  
  106. It may be clearer if we include some of the things that we DON'T want
  107. to make the example clearer (it sounds like double-dutch to me too!).
  108.  
  109. In the /public area, there are MANY other directories connected to it
  110. just like the branches of a tree. Each "branch" has a name.
  111.  
  112. /                             ___ NNTP.TXT
  113. /            _________DEBATE_|
  114. /           |                |___ other files
  115. /           |
  116. /           |__________TCPIP_____ RFC ____ RFC1033.TXT
  117. /           |                |         |
  118. /PUBLIC_____|_INDEX.TXT      |_ etc    |__ RFC1034.TXT
  119. /           |                          |
  120. /           |_NEWFILES.TXT             |__ RFC1035.TXT
  121. /          etc                        etc
  122. /
  123. /IN-TRAY
  124. /
  125. /            _______G9AAA
  126. /           |
  127. /USR________|_______G9AAB      
  128. /           |
  129. /           |_______G9AAC
  130. /          etc
  131.  
  132. A few more examples may (I hope) make it clearer.
  133.  
  134. Required file          Path to it
  135.  
  136. INDEX.TXT              /public
  137. NNTP.TXT               /public/debate
  138. RFC1033.TXT            /public/tcpip/rfc
  139.  
  140.  
  141. I have written the PINDEX (Public INDEX) program to make this navigation
  142. easier. It gives the path to the file and the details and nature of 
  143. the file.
  144.  
  145.  
  146. GETTING TO THE REQUIRED DIRECTORY
  147. =================================
  148. These are the commands that enable you to navigate the directories,
  149. to see where you are, and to see what's available.
  150.  
  151. COMMAND      MEANS
  152.  
  153. cd           Change Directory
  154. pwd          Print Working Directory (i.e. where am I?).
  155. dir          DIRectory - lists all the files and directories available.
  156.              in the working directory (i.e. where we are).
  157. ls           List contents of this directory (same as dir but without
  158.              dates and sizes, i.e. just names).
  159.  
  160. So, to go back to the previous example, let's say that when we arrive,
  161. we find ourselves in /usr/g9xyz directory. 
  162.  
  163. To get to the /public area, we type;   cd /public
  164.  
  165. No matter where we are, cd /public will take us all the way down to the
  166. bottom of the tree into the PUBLIC directory. The "/" makes sure of that.
  167. It's like saying "take me to the public directory that is at the root
  168. of the tree".
  169.  
  170. If you were to type;  cd public  instead, then the host would look for a
  171. directory called "public" in where you are at that moment. If you are in
  172. the root directory, then the host would find "public" because "public"
  173. IS in the root directory. But if you were up the tree a bit in say
  174. /public/tcpip/rfc then typing  cd public  would not do very much at all
  175. because there is no directory called "public" in the rfc directory.
  176.  
  177. Just think of directories as drawers. In those drawers there are items and
  178. other mini drawers. Sort of boxes withing boxes. The drawers are the
  179. directories, and the odd items in the drawers are the files that are
  180. stored there.
  181.  
  182. So by typing; cd /public  we can make sure we are where we want to be.
  183.  
  184. To move up into the branches of the directory tree, we use "cd" again.
  185. We can either do it all in one go or in steps.
  186.  
  187. First in steps. Our target directory is the RFC one because we are
  188. really keen to know about tcp/ip... aren't we?...
  189.  
  190. cd /public       puts us right down the bottom, but we know where we
  191.                  are when we start here.
  192.  
  193. cd tcpip         note that there isn't a "/" before "tcpip". That's
  194.                  because "tcpip" isn't down at the "root" of the tree.
  195.  
  196. cd rfc           whoopee! We made it.
  197.  
  198. That was the slow way of doing it, but can you see the logic in it?
  199. We started by first going to the public directory. We then told the 
  200. host that we wanted to go into the tcpip directory which it should
  201. look for in the public directory. Then we said go into the rfc directory
  202. which it should look for in the tcpip directory. Providing that the
  203. directories we've asked for exist, everything will go to plan.
  204.  
  205. And now the quick way;
  206.  
  207. cd /public/tcpip/rfc
  208.  
  209. Whammo, kappow! We're there in a twinkling of an eye. This is like saying
  210. "Go to rfc which is in tcpip which is in public. You know where it is now
  211. so take me straight there." And it does!
  212.  
  213. There are two ways of climbing back down the tree form /public/tcpip/rfc.
  214.  
  215. The hard way; 
  216.  
  217. cd /public/tcpip     takes us back down by one directory to the "parent"
  218.                      directory. i.e. tcpip is the "parent" of rfc and
  219.                      rfc is the "child" of tcpip. I'm sneaking the
  220.                      terminology used in the industry into this
  221.                      explanation so you'll understand what other people
  222.                      are talking about.
  223.  
  224. The easy way;
  225.  
  226. cd ..                (gasp!) Wasn't that easy? ".." means PARENT directory,
  227.                      so saying  cd ..  means, "change directory from the
  228.                      directory where I am to it's parent (i.e. the one
  229.                      immediately below this one)".
  230.  
  231. Not wishing to confuse you but you should know that you can jump more than
  232. one directory backwards by using the / again, like this;
  233.  
  234. cd ../..             would take us back to the parent of the parent!!!
  235.                      but that's just for information.
  236.  
  237. So now we know how to climb the tree and how to climb down again, let's
  238. see how to examine what is available by way of files at each "branch".
  239.  
  240. cd /public           takes us all the way to the bottom of the tree into
  241.                      the public directory.
  242.  
  243. dir                  will list all of the files and child directories
  244.                      available to us. (so will typing ls).
  245.  
  246. So we can see what is available at each step by using dir or ls.
  247.  
  248. Some systems don't tell you where you are, so if you aren't sure, just
  249. type;  pwd  at the ftp> prompt. To remind you, it means "Print the
  250. Working Directory" or in plain english, "Tell me where the heck I am!"
  251. (yes I know that's not what you say but it's my license!).
  252.  
  253.  
  254. GETTING A FILE:
  255. ===============
  256. Getting a file is easy. Deciding where to put it isn't so I recommend that
  257. you do the following.
  258.  
  259. On your computer, make a directory off /nos (PC) or tcpip: (amiga) called
  260. TRANSIT (or some other type of van... just a joke) for files in transit.
  261.  
  262. Now the rest is easy.
  263.  
  264. "cd" TO THE DIRECTORY WHERE THE FILE IS you want to "get". Let's start
  265. with getting the index.txt file since that will open the rest up for you.
  266.  
  267. Amiga
  268. =====
  269.  
  270. cd /public                                
  271. get index.txt tcpip:transit/index.txt  
  272.  
  273. PC
  274. ==
  275.  
  276. cd /public
  277. get index.txt /transit/index.txt
  278.  
  279. Do you see that in both cases we have to tell our own system where to put
  280. the file that it receives?
  281.  
  282. I definately recommend that you don't download files directly into your
  283. NOS or TCPIP: directories as you will end up overwriting some essential
  284. system file sooner rather than later!!! (Guess how I know...).
  285.  
  286. The heart of this is the "get" command.
  287.  
  288. Explained:
  289.  
  290.           get index.txt /transit/index.txt
  291.            |      |         |        |______ What it's to be called on
  292.            |      |         |                our own system.
  293.            |      |         |
  294.            |      |         |_______________ The path on our own system
  295.            |      |                          where the file is to be put
  296.            |      |
  297.            |      |_________________________ What the file is called on
  298.            |                                 the host
  299.            |
  300.            |________________________________ ftp command "get" this file
  301.  
  302.  
  303.           get <hostfile> <put_it_here_and>/<call_it_this>
  304.  
  305.  
  306. PUTTING A FILE:
  307. ===============
  308.  
  309. Exactly the same principle as "get", put behaves the same.
  310.  
  311.           put /transit/myfile.txt g9xxx.txt 
  312.            |      |         |        |______ What it's to be called on
  313.            |      |         |                the host system.
  314.            |      |         |
  315.            |      |         |_______________ What the file is called on
  316.            |      |                          your system
  317.            |      |
  318.            |      |_________________________ The path to your file on
  319.            |                                 your system
  320.            |
  321.            |________________________________ ftp command "get" this file
  322.  
  323.  
  324. Note that with the "put" command, we have to tell our own system where to
  325. find the file that we wish to send!
  326.  
  327.  
  328. A QUICK WORD ABOUT FILE NAMES:
  329. ==============================
  330. Different computers can use different filename conventions. For instance
  331. the Amiga and Unix machines allow 32 character filenames. The Amiga
  332. allows you to have spaces within the filenames too! And clearly, the
  333. lack of conformity will cause grief somewhere along the line which is
  334. why I recommend you use the PC filename convention. All other machines
  335. (apart from the BBC micro if I remember rightly) will accept the PC
  336. format of filenames so that's the one I recommend you use.
  337.  
  338. The PC allows you to have 8 characters followed by a full stop followed
  339. by 3 characters with no spaces inbetween. Also, certain characters are
  340. not allowed on the PC where they might be on other machines.
  341.  
  342. Here are some examples of valid PC filenames;
  343.  
  344.   MY_FILE      ANOTHER.FIL      AN-OTHER.1     ABCDEFGH.XYZ
  345.  
  346.   1.BAT        NOS.EXE          COMMAND.COM    THIS_IS.OK2
  347.  
  348. And here are some definate no-no's;
  349.  
  350.   $.USD        BRIGHT*.1        MY.FILE        QUESTION.???
  351.  
  352.   MY .FIL      .POI             >ANOTHER.CHR   AND<THIS.TOO
  353.  
  354. The problems (in order of appearance) are;
  355.  
  356.   dollar is a special character
  357.   asterisk is a special character
  358.   my.file has four letters after the '.' which is illegal
  359.   question mark is a special character
  360.   spaces in names aren't allowed
  361.   there must be something before the '.' character
  362.   the > character is a special character
  363.   the < character is a special character
  364.  
  365. What I mean by "special character" is that DOS (the Disk Operating System)
  366. on the PC treats these characters differently to others. For instance,
  367. the ? character in PC DOS is used to represent a "wild card", that is, it
  368. can be substituted by any single character. Likewise, the * is also a
  369. wild card that is used to say "any combination of characters". The Amiga
  370. likewise uses ? to say any character but instead uses the two character
  371. sequence #? to say any combination of any characters. The $ is a very
  372. special case on the PC and is used when you do not wish a user to be able
  373. to modify or delete a file without a partular program. The > and <
  374. characters are for "redirection", which means, sending something somewhere
  375. other than where it was going originaly. For instance, one could get a
  376. file to go to a printer instead of the screen by redirecting the output
  377. to LPT1: or PRN: e.g. DIR > LPT1: sends a directory of the files to the
  378. printer instead of the screen. The Amiga uses slight variations of the
  379. same principle. By the way, don't use the ':' character within the name.
  380. Just about every computer uses this character to say that you are
  381. refering to some device. e.g. on the PC, C: means the first hard disk
  382. drive, and on the Amiga, DF0: means the first floppy disk drive. So only
  383. use it in reference to your own computers disks or devices, not in the
  384. file names themselves. e.g. (on the Amiga);  get afile.txt df0:afile.txt
  385. is perfectly fine, but;  get afile.txt df0:afile:txt  is not.
  386. I'm sure you get the picture.                   ^
  387.  
  388. For simplicity, I recommend the following; When naming files, use
  389. characters A-Z and numbers 0-9. Where appropriate, use the _ (underscore
  390. character) and - (minus) to make names clearer. e.g. FTP_INFO.TXT is a
  391. sensible name because it is clear that the file is an information file
  392. about ftp that is plain text (.TXT) and not a program.
  393.  
  394. As a matter of interest, the system often uses the phrase
  395. "Permission denied" to cover a multitude of sins, it can mean that you
  396. are using a file name that is illegal, and it can also mean that a file
  397. already exists of that name (if you are putting one on the host or
  398. getting one to your own system). So try changing the name if you see
  399. the above message, it may be as simple as that.
  400.  
  401. There we are, a DOS course thrown in too!... Now back to ftp...
  402.  
  403.  
  404. DIFFERENT TYPES OF FILE TRANSFER:
  405. =================================
  406. There are what are know as ASCII and IMAGE transfers. IMAGE is usually the
  407. default (that's why you will often see "TYPE I" appear when you are
  408. getting or putting a file).
  409.  
  410. IMAGE is for programs and data. Everything remains EXACTLY as it was in
  411. the original. This is how you can store Amiga programs on a PC host
  412. and vice versa.
  413.  
  414. ASCII is very useful since it converts line ending of text files to be
  415. compatible with your own computer during a get and to that of the host
  416. during a put.
  417.  
  418. So to grab a PC text file and read it on an Amiga, or vice versa, at the
  419. ftp> prompt, before you put or get a file, you enter the following;
  420.  
  421. ftp> type a
  422.      ------.
  423.            `- you type this exactly as shown "type a" which means
  424.               "type ascii".
  425.  
  426. And the computer will convert the file for you as you send/receive it.
  427.  
  428. You can then go ahead and get or put the file, but don't forget to enter;
  429. type i   if you are going to get a program next to tell it you want the
  430.          unconverted image of the file!!!
  431.  
  432.  
  433. HOW TO QUIT:
  434. ============
  435. At the ftp> prompt, type; quit
  436.  
  437. Or you can try punching the boss in the eye. That works too...
  438.  
  439.  
  440. OTHER AVAILABLE COMMANDS:
  441. =========================
  442. Not all of them. This is a "How to get started" tuitional, not a
  443. "So you want to be an expert".
  444.  
  445.  
  446. abort
  447. =====
  448. If you are transfering a file and want to abort it, press [ESC] to
  449. take you to the command screen and enter;  abort
  450. Press enter again to take you back to the ftp session. In a few seconds
  451. or so, the ftp transfer will stop and you'll get the ftp> prompt back.
  452.  
  453. Abort is valid only when a transfer is in progress.  When a 'get'
  454. or 'put' operation is aborted, a partial copy of the transferred
  455. file will be left on the destination machine.  This copy must be
  456. removed manually if it is unwanted.
  457.  
  458.  
  459. dele <remote_filename>
  460. ======================
  461. Deletes a file on the host system. On the poi hub, you only have
  462. permission to delete files in your own private /usr/callsign areas.
  463. This is to make the system safe against mishaps and to make you feel
  464. confident that you can't hurt anything vital while playing with ftp.
  465.  
  466.  
  467. hash
  468. ====
  469. This is the equivalent to the verbose 3 command (later in this file)
  470.  
  471.  
  472. mkdir <remote_directory_name>
  473. =============================
  474. Creates a directory on the host. Have a play with this in your own
  475. areas on the hub. It's useful if you are sending stuff to another
  476. station and want your files to be kept separate.
  477.  
  478. An example:
  479.  
  480. cd /public           puts you in their public directory
  481.  
  482. mkdir de-g9zzz       creates a new directory called g9zzz
  483.  
  484. cd de-g9zzz          puts you up in the new directory called
  485.                      /public/de-g9zzz
  486.  
  487. Note: there is an 8 character limit to directory and file names on PC's
  488.       (if you don't include a suffix - I'll explain that if you ask nicely).
  489.  
  490.  
  491. rmdir <remote_directory_name>
  492. =============================
  493. Means ReMoveDIRectory. You can only do this if you, a) have permissions
  494. for it, and, 2) if the directory is empty.
  495.  
  496.  
  497. verbose n (where n = 0, 1, 2, or 3)
  498. ===================================
  499. i.e. how verbose you want the system messages to be. The four ranges are;
  500.  
  501. 0 - Error messages only.
  502.  
  503. 1 - Error messages, plus a one-line summary after each
  504.     transfer giving the name of the file, its size, and the
  505.     transfer time and rate.
  506.  
  507. 2 - Error and summary messages, plus the progress messages
  508.     generated by the remote FTP server.
  509.  
  510. 3 - Display all messages. In addition, a "hash mark" (#) is
  511.     displayed for every 1,000 bytes sent or received.
  512.     "verbose 3" has an alias, typing "hash" has the same effect
  513.     (see above).
  514.  
  515.  
  516. SUMMARY:
  517. ========
  518. ftp is a really useful tool. You should practice with it until you are
  519. happy transfering files too and from each other and the local hubs since
  520. it is a marvelous source of new programs and information.
  521.  
  522. Have fun, and, Share and Enjoy!
  523.  
  524. 73 de Dave
  525.  
  526. g4poi.ampr.org. IP 44.131.19.160  Mail to g4poi@g4poi
  527. Sysop to the g4poi hub located in Northaw village, South Herts
  528.  
  529.